package com.example.common.resp;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.annotation.Nonnull;

/**
 * @author ZhengDing
 * @date 2022/2/20 22:30
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResultInfo {
    private Integer code;
    private String msg;
    private Object data;
    
    public static ResultInfo error(int code, String msg) {
        ResultInfo resultInfo = new ResultInfo();
        resultInfo.setCode(code);
        resultInfo.setMsg(msg);
        resultInfo.setData("");
        return resultInfo;
    }
}
